﻿@{
	string FlowID = Request.QueryString["flowid"];
	string StepID = Request.QueryString["stepid"];
	string GroupID = Request.QueryString["groupid"];
	string TaskID = Request.QueryString["taskid"];
	string InstanceID = Request.QueryString["instanceid"];
	string DisplayModel = Request.QueryString["display"] ?? "0";
	string DBConnID = "06075250-30dc-4d32-bf97-e922cb30fac8";
	string DBTable = "TempTest_Purchase";
	string DBTablePK = "ID";
	string DBTableTitle = "Title";
if(InstanceID.IsNullOrEmpty()){InstanceID = Request.QueryString["instanceid1"];}	RoadFlow.Platform.Dictionary BDictionary = new RoadFlow.Platform.Dictionary();
	RoadFlow.Platform.WorkFlow BWorkFlow = new RoadFlow.Platform.WorkFlow();
	RoadFlow.Platform.WorkFlowTask BWorkFlowTask = new RoadFlow.Platform.WorkFlowTask();
	string fieldStatus = BWorkFlow.GetFieldStatus(FlowID, StepID);
	LitJson.JsonData initData = BWorkFlow.GetFormData(DBConnID, DBTable, DBTablePK, InstanceID, fieldStatus);
	string TaskTitle = BWorkFlow.GetFromFieldData(initData, DBTable, DBTableTitle);
}
<link href="~/Scripts/FlowRun/Forms/flowform.css" rel="stylesheet" type="text/css" />
<script src="~/Scripts/FlowRun/Forms/common.js" type="text/javascript" ></script>
<input type="hidden" id="Form_ValidateAlertType" name="Form_ValidateAlertType" value="2" />
<input type="hidden" id="Form_TitleField" name="Form_TitleField" value="TempTest_Purchase.Title" />
<input type="hidden" id="Form_DBConnID" name="Form_DBConnID" value="06075250-30dc-4d32-bf97-e922cb30fac8" />
<input type="hidden" id="Form_DBTable" name="Form_DBTable" value="TempTest_Purchase" />
<input type="hidden" id="Form_DBTablePk" name="Form_DBTablePk" value="ID" />
<input type="hidden" id="Form_DBTableTitle" name="Form_DBTableTitle" value="Title" />
<input type="hidden" id="Form_AutoSaveData" name="Form_AutoSaveData" value="1" />
<script type="text/javascript">
	var initData = @Html.Raw(BWorkFlow.GetFormDataJsonString(initData));
	var fieldStatus = "1"=="@Request.QueryString["isreadonly"]" ? {} : @Html.Raw(fieldStatus);
	var displayModel = '@DisplayModel';
	$(window).load(function (){
		formrun.initData(initData, "TempTest_Purchase", fieldStatus, displayModel);
	});
</script>
<p><br/></p><p><br/></p><p style="TEXT-ALIGN: center"><span style="FONT-SIZE: 20px"><strong>物资采购申请</strong></span><br/></p><table class="flowformtable" cellspacing="1" cellpadding="0" data-sort="sortDisabled" uetable="null"><tbody><tr class="firstRow"><td width="102" valign="top" style="WORD-BREAK: break-all">申请人：<br/></td><td width="434" valign="top" style="WORD-BREAK: break-all"><input type="text" type1="flow_org" id="TempTest_Purchase.UserID" name="TempTest_Purchase.UserID" value="u_@RoadFlow.Platform.Users.CurrentUserID.ToString()" more="0" isflow="1" class="mymember" title="" dept="0" station="0" user="1" workgroup="0" unit="0" rootid=""/> </td><td width="97" valign="top" style="WORD-BREAK: break-all">部门：</td><td width="439" valign="top"><input type="text" type1="flow_org" id="TempTest_Purchase.UserDept" name="TempTest_Purchase.UserDept" value="@(RoadFlow.Platform.Users.CurrentDeptID)" more="0" isflow="1" class="mymember" title="" dept="1" station="0" user="0" workgroup="0" unit="0" rootid=""/></td></tr><tr><td width="102" valign="top" style="WORD-BREAK: break-all">申请日期：<br/></td><td width="434" valign="top" style="WORD-BREAK: break-all"><input type="text" type1="flow_datetime" id="TempTest_Purchase.SqDateTime" name="TempTest_Purchase.SqDateTime" value="@(RoadFlow.Utility.DateTimeNew.ShortDate)" defaultvalue="@(RoadFlow.Utility.DateTimeNew.ShortDate)" istime="0" daybefor="0" dayafter="1" currentmonth="0" isflow="1" class="mycalendar" title=""/> <input type="hidden" id="TempTest_Purchase.Title" name="TempTest_Purchase.Title" isflow="1" type1="flow_hidden" value="@(RoadFlow.Platform.Users.CurrentUserName)的物资采购申请"/></td><td width="97" valign="top" style="WORD-BREAK: break-all">备注：</td><td width="439" valign="top"><input name="TempTest_Purchase.Note" id="TempTest_Purchase.Note" style="WIDTH: 80%" type="text" value="" type1="flow_text" valuetype="0" isflow="1" class="mytext" title=""/></td></tr><tr><td valign="top" style="WORD-BREAK: break-all" rowspan="1" colspan="4">申请明细：</td></tr><tr><td valign="top" colspan="4"><div><script type="text/javascript">function subtable_addrow_TempTest_PurchaseList_ID_ID_PurchaseID(){var subtableid = "TempTest_PurchaseList_ID_ID_PurchaseID";var instanceid = "@InstanceID";var tabid = '@Request.QueryString["tabid"]';var appid = '@Request.QueryString["appid"]';if($.trim(instanceid).length==0){alert("请先保存主表数据再添加!");return;}new RoadUI.Window().open({url:"/WorkFlowRun/SubTableEdit?flowid=@FlowID&stepid=@StepID&secondtableeditform=d4d48c6c-d7f1-465e-bda4-16530a384de2&primarytableid=" + instanceid + "&secondtablerelationfield=TempTest_PurchaseList.PurchaseID&appid="+appid,openerid:tabid,title:"添加",height:300,width:650});}function subtable_editrow_TempTest_PurchaseList_ID_ID_PurchaseID(id){var subtableid="TempTest_PurchaseList_ID_ID_PurchaseID";var instanceid="@Request.QueryString["instanceid"]";var tabid='@Request.QueryString["tabid"]';var appid = '@Request.QueryString["appid"]';new RoadUI.Window().open({url:"/WorkFlowRun/SubTableEdit?flowid=@FlowID&stepid=@StepID&secondtableeditform=d4d48c6c-d7f1-465e-bda4-16530a384de2&secondtable=TempTest_PurchaseList&secondtableconnid=@DBConnID&secondtableprimarykey=ID&instanceid="+id+"&primarytableid="+instanceid+"&secondtablerelationfield=TempTest_PurchaseList.PurchaseID&appid="+appid,openerid:tabid,title:"编辑",height:300,width:650});}function subtable_deleterow_TempTest_PurchaseList_ID_ID_PurchaseID(id){var subtableid = "TempTest_PurchaseList_ID_ID_PurchaseID";var instanceid = "<%=InstanceID%>";var tabid = '@Request.QueryString["tabid"]';var appid = '@Request.QueryString["appid"]';if(!confirm("您真的要删除该记录吗?")){return;}$.ajax({url:"/WorkFlowRun/SubTableDelete?secondtableeditform=d4d48c6c-d7f1-465e-bda4-16530a384de2&secondtableconnid=@DBConnID&secondtable=TempTest_PurchaseList&secondtableprimarykey=ID&secondtablepkvalue="+id+"&appid="+appid,async:false,cache:false,success:function(txt){alert(txt);window.location=window.location;}});}</script><table class="flowformsubtable" style="width:99%;margin:0 auto;" cellPadding="0" cellspacing="1" issubflowtable="1" id="subtable_TempTest_PurchaseList_ID_ID_PurchaseID"><thead><tr><th style="text-align:left;">名称</th><th style="text-align:left;">型号</th><th style="text-align:left;">单位</th><th style="text-align:left;">数量</th><th style="text-align:left;">金额</th><th style="text-align:left;">日期</th><th style="text-align:left;">类型</th><th style="text-align:left;">备注</th><th style="width:10%; text-align:left;"><input type="button" value="添加" onclick="subtable_addrow_TempTest_PurchaseList_ID_ID_PurchaseID();"/></th></tr></thead><tbody>@{System.Data.DataTable Dt = new RoadFlow.Platform.DBConnection().GetDataTable(DBConnID, "TempTest_PurchaseList","PurchaseID", InstanceID);RoadFlow.Platform.WorkFlowForm bWorkFlowForm = new RoadFlow.Platform.WorkFlowForm();foreach(System.Data.DataRow dr in Dt.Rows){<tr><td>@bWorkFlowForm.GetDisplayString(dr["Name"].ToString(), "normal", "", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Model"].ToString(), "normal", "", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Unit"].ToString(), "normal", "", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Quantity"].ToString(), "normal", "", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Sum1"].ToString(), "normal", "", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Date"].ToString(), "datetime_format", "yyyy-MM-dd", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Type"].ToString(), "normal", "", DBConnID, "" )</td><td>@bWorkFlowForm.GetDisplayString(dr["Note"].ToString(), "normal", "", DBConnID, "" )</td><td><input type="button" value="编辑" onclick="subtable_editrow_TempTest_PurchaseList_ID_ID_PurchaseID('@dr["ID"]');" style="margin-right:4px;" name="flowsubtable_TempTest_PurchaseList_ID_ID_PurchaseID_editbutton" /><input type="button" value="删除" onclick="subtable_deleterow_TempTest_PurchaseList_ID_ID_PurchaseID('@dr["ID"]');" name="flowsubtable_TempTest_PurchaseList_ID_ID_PurchaseID_editbutton"/></td></tr>}}</tbody></table></div></td></tr></tbody></table><p><br/></p>